package com.yanqu.road.server.cmd.activity.yearMaster;

import com.yanqu.road.pb.yearMaster.YearMasterProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.yearMaster.YearMasterMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C2_CROSS_YEAR_MASTER_NOTIFY, desc = "瑞兽降福活动信息同步")
public class CrossYearMasterSyncCmd extends CrossCommand {
    private int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        YearMasterProto.CrossYearMasterNotifyInfoReqMsg reqMsg = YearMasterProto.CrossYearMasterNotifyInfoReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        YearMasterMgr.syncActivity(activityId);
    }

    @Override
    public void sendData() {

    }
}
